<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type='text/javascript' src='js/newsy.js'></script>
</head>
<body>
<div class=kontakt>
<%
HttpSession sesja = request.getSession(true);
if(sesja.getAttribute("log")!=null && sesja.getAttribute("log").equals("pracownik")){
	if(sesja.getAttribute("lang").equals("en")){%>
		<div class=formularz>
		<fieldset class=obrys>
		<br>
		<input class=przycisk type='button' value='IMG' style="width=50px;" onClick="img()" title="Insert image">
		<input class=przycisk type='button' value='URL' style="width=50px;" onClick='url()' title="Insert hyperlink">
		<input class=przycisk type='button' value='BR' style="width=50px;" onClick='br()' title="New line">
		<input class=przycisk type='button' value='B' style="width=50px;" onClick='bold()' title="Bold">
		<input class=przycisk type='button' value='i' style="width=50px;" onClick='italic()' title="Italic">
		<input class=przycisk type='button' value='U' style="width=50px;" onClick='underline()' title="Underline"><br><br>
		<form id=news name=news method=post action=#>
		<textarea style="width:95%; height:400px;" name='trescnewsa' id='trescnewsa'></textarea><br>
		<input type='checkbox' value='jezyk' name='jezyk'>English (Check if this news is in English)
		<br/><br>
		<input class=przycisk type='button' value='Preview' style="width=100px;" onClick='preview()'>
		<input class=przycisk type='button' value='Save' style="width=100px;" onClick='save()' id='zapisz'>
		<input class=przycisk type='button' value='Clean' style="width=100px;" onClick='this.form.reset()'>
		<br><br>
		<div id=podglad style='width:95%;overflow: hidden;'>&nbsp;</div>
		</form>
		</fieldset>
		</div>	
		<%}else{ %>
		<div class=formularz>
		<fieldset class=obrys>
		<br>
		<input class=przycisk type='button' value='IMG' style="width=50px;" onClick="img()" title="Wstaw zdjęcie">
		<input class=przycisk type='button' value='URL' style="width=50px;" onClick='url()' title="Wstaw link">
		<input class=przycisk type='button' value='BR' style="width=50px;" onClick='br()' title="Nowa linia">
		<input class=przycisk type='button' value='B' style="width=50px;" onClick='bold()' title="Pogrubienie (bold)">
		<input class=przycisk type='button' value='i' style="width=50px;" onClick='italic()' title="Kuryswa (italic)">
		<input class=przycisk type='button' value='U' style="width=50px;" onClick='underline()' title="Podkreślenie (underline)"><br><br>
		<form id=news name=news method=post action=#>
		<textarea style="width:95%; height:400px;" name='trescnewsa' id='trescnewsa'></textarea><br>
		<input type='checkbox' value='jezyk' name='jezyk'>j. angielski (Zaznacz jeżeli ten news jest w j. angielskim)
		<br/><br>
		<input class=przycisk type='button' value='Podgląd' style="width=100px;" onClick='preview()'>
		<input class=przycisk type='button' value='Zapisz news' style="width=100px;" onClick='save()' id='zapisz'>
		<input class=przycisk type='button' value='Wyczy&#347;&#263;' style="width=100px;" onClick='this.form.reset()'>
		<br><br>
		<div id=podglad style='width:95%;overflow: hidden;'>&nbsp;</div>
		</form>
		</fieldset>
		</div>		
<%}}else{
	if(sesja.getAttribute("lang").equals("en")){%>
		<br><img src="images/stop.png" width=30% height=30%><br><br>
		<h1>ACCESS DANIED</h1><br>
		You don't have permission to access this page.<br>
		<%if(!sesja.getAttribute("log").equals("admin") && !sesja.getAttribute("log").equals("klient")) %>Log in first.
		<br><br>	
	<%}else{ %>
		<br><img src="images/stop.png" width=30% height=30%><br><br>
		<h1>DOSTĘP ZABRONIONY</h1><br>
		Nie masz uprawnień do oglądania tej strony.<br>
		<%if(!sesja.getAttribute("log").equals("admin") && !sesja.getAttribute("log").equals("klient")) %>Zaloguj się najpierw.
		<br><br>
<%}}%>
</div>
</body>
</html>